package com.mao.service.impl.adminmanage;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mao.action.jsonvo.store.JsonVoStore;
import com.mao.action.jsonvo.store.JsonVoUser;
import com.mao.dao.adminmanage.AdminManageDao;
import com.mao.model.store.Store;
import com.mao.model.user.User;
import com.mao.service.adminmanage.IAdminManageService;

@Service("adminManageService")
public class AdminManageService implements IAdminManageService {

	private AdminManageDao adminManageDao;

	public List<JsonVoStore> getAllStore(String name) {
		return adminManageDao.getAllStore(name);
	}
	
	public Store getStoreById(long id) {
		return adminManageDao.getStoreById(id);
	}
	
	public Integer getAllStoreCount(String name) {
		return adminManageDao.getAllStoreCount(name);
	}
	
	public Store saveOrUpdateStore(Store store) {
		return adminManageDao.saveOrUpdateStore(store);
	}
	
	public List<JsonVoUser> getAllUser(String loginName) {
		return adminManageDao.getAllUser(loginName);
	}
	
	public Integer getAllUserCount(String loginName) {
		return adminManageDao.getAllUserCount(loginName);
	}
	
	public User saveOrUpdateUser(User user) {
		return adminManageDao.saveOrUpdateUser(user);
	}
	
	public User getUserById(long id) {
		return adminManageDao.getUserById(id);
	}
	
	public String valDelStore(long id) {
		return adminManageDao.valDelStore(id);
	}
	
	public List<JsonVoUser> getUserByStore(long storeid) {
		return adminManageDao.getUserByStore(storeid);
	}
	
	public Integer getUserByStoreCount(long storeid) {
		return adminManageDao.getUserByStoreCount(storeid);
	}

	public AdminManageDao getAdminManageDao() {
		return adminManageDao;
	}
	
	@Autowired
	public void setAdminManageDao(AdminManageDao adminManageDao) {
		this.adminManageDao = adminManageDao;
	}

}
